<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>成功</title>
		<script src="js/mui.min.js"></script>
		<link href="css/mui.min.css" rel="stylesheet" />
		<style>
			.main {
				width: 80%;
				height: 300px;
				margin: 110px auto;
			}
			
			input.text {
				text-align: center;
				padding: 10px 20px;
				width: 300px;
			}
			.mui-bar{
				background: #BBE0E3;
			}
			.mui-bar a{
				color: #fff;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		</header>
		<div class="main">
			<div style="text-align: center;">领取成功</div>
			<div style="margin-top: 20px;"><input type="text" value="1551241*-42152" id="text" style="border: 1px solid #BBE0E3;text-align:center" disabled="disabled"></div>
			<div style="margin-top: 20px;text-align: center;">
				<button type="button" class="mui-btn cuccess_sureBtn" style="width: 86px;background-color: #BBE0E3;border: 1px solid #BBE0E3;margin-right: 26px;">确定</button>
				<button type="button" class="mui-btn buttonsize" style="width: 86px;background-color: #BBE0E3;border: 1px solid #BBE0E3; ">复制</button>
			</div>
		</div>
		<script type="text/javascript" src="js/jquery.min.js" ></script>
		<script type="text/javascript" charset="utf-8">
			mui.init();
			/*点击复制*/
			$("body").on("tap", ".cuccess_sureBtn", function() {
				mui.openWindow({
					url: "gift.html",
					id: "gift.html",
					show: { //控制打开页面的类型
						autoShow: true,
						//					//页面loaded事件发生后自动显示，默认为true 
						aniShow: 'zoom-fade-out', //页面显示动画，默认为”slide-in-right“；  页面出现的方式 左右上下
						duration: '500' //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒； 
					},
				})
			})
			$("body").on("tap", ".buttonsize", function() {
				mui.plusReady(function() {
					//复制链接到剪切板
					var copy_content = $("#text").val();
					//判断是安卓还是ios
					if(mui.os.ios) {
						//ios
						var UIPasteboard = plus.ios.importClass("UIPasteboard");
						var generalPasteboard = UIPasteboard.generalPasteboard();
						//设置/获取文本内容:
						generalPasteboard.plusCallMethod({
							setValue: copy_content,
							forPasteboardType: "public.utf8-plain-text"
						});
						generalPasteboard.plusCallMethod({
							valueForPasteboardType: "public.utf8-plain-text"
						});
						mui.toast("复制成功");
					} else {
						//安卓
						var context = plus.android.importClass("android.content.Context");
						var main = plus.android.runtimeMainActivity();
						var clip = main.getSystemService(context.CLIPBOARD_SERVICE);
						plus.android.invoke(clip, "setText", copy_content);
						mui.toast("复制成功");
					}
				});
			});
		</script>
	</body>

</html>